package leecode;

/**
 * @author csp 2024-06-26
 */
public class Question392 {

    public static void main(String[] args) {
        System.out.println(new Question392().isSubsequence("abc", "ahbgdc"));
    }

    public boolean isSubsequence(String s, String t) {
        int i = 0;
        for (int j = 0; i < s.length() && j < t.length(); j++) {
            if (s.charAt(i) == t.charAt(j)) {
                i++;
            }
        }
        if (i == s.length()) {
            return true;
        }
        return false;
    }

}
